package com.yztc.administrator.meishi.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import android.widget.VideoView;

import com.yztc.administrator.meishi.R;

public class WebViewActivity extends AppCompatActivity {

    private VideoView wv;
    private TextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        //找到控件
        init();
        //获取传递数值
        Intent intent = getIntent();
        String path = intent.getStringExtra("path");
        String caption = intent.getStringExtra("caption");
        //path转型
        Uri uri = Uri.parse(path);
        //设置控件
        wv.setVideoURI(uri);
        tv.setText(caption);
    }

    private void init() {
        wv = (VideoView) findViewById(R.id.wv);
        tv = (TextView) findViewById(R.id.tv_wv);
    }

}
